//
//  BackgroundMaintain.h
//  etionMisc
//
//  Created by wjxfhxy on 14-3-20.
//  Copyright (c) 2014年 GuangZhouXuanWu. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol CBackgroundMaintainDelegate <NSObject>

-(BOOL)isNeedBackgroundMaintain;

@end

@interface XMSBackgroundMaintain : NSObject

+(void)initBackgroundMaintain;

+(void)releaseBackgroundMaintain;

+(void)addBackgroundService:(NSDictionary*)service;

+(void)removeBackgroundService:(NSArray*)serviceKey;

+(void)removeAllBackgroundService;

+(BOOL)isNeedMaintain;

+(void)startMaintainWithSuspendBlock:(void(^)())block;

//+(void)stopMaintain;

//+(BOOL)isMaintaining;

+(BOOL)stopMaintainIfMaintaining;

+(BOOL)isBackgrounsService:(NSString*)serviceKey;

+(void)terminateMaintain;

@end

@interface XMSBackgroundMaintain (BackgroundService)

+(void)backgroundTaskIsFinished:(NSString*)serviceKey;

@end
